<template>
  <div>
    <h1>Father 组件 插件</h1>
    <input type="text"  v-model="vprice"/>
    <button @click="search">搜索</button>
    <button @click="reset">重置</button>
    <hr/>
    <Son/>
  </div>
</template>

<script setup>
import { ref } from 'vue';
import useStore from './store';
import Son from './Son.vue';

const vprice = ref('');

const store = useStore();

const search = e => {
  store.searchAction({price:Number(vprice.value)})
};

const reset = e => {
  vprice.value = '';
 /*  store.$patch( state => {
    state.list = [...state.originList];
  } ) */
  store.$reset();
}


</script>

<style lang="scss" scoped>

</style>